
#ifndef MaterialPhongVolume_h
#define MaterialPhongVolume_h

#include "Array3.h"
#include "Material.h"
#include "Color.h"
#include "Colormap.h"
#include "Point.h"
#include "Vector.h"

class MaterialPhongVolume : public Material {
 public:
  MaterialPhongVolume(const std::string& headername,
                      const std::string& cmapname,
                      const Point& lower, const Point& upper,
                      double stepsize, float maxopacity,
                      float Kd, float Ka,
                      const Color& phong_color, int phong_exponent);
  virtual ~MaterialPhongVolume();

  virtual void shade(Color& result, const RenderContext& context, const Ray& ray,
                     const HitRecord& hit, const Color& atten, int depth) const;

 private:
  MaterialPhongVolume(const MaterialPhongVolume&);
  MaterialPhongVolume& operator=(const MaterialPhongVolume&);

  Colormap cmap;
  Point lower, upper;
  Vector diag;
  Vector cellsize;
  double grid_stepsize;
  double world_stepsize;
  float maxopacity;
  float Kd;
  float Ka;
  Color phong_color;
  int phong_exponent;
  Array3<short> data;
};

#endif